React State Machine with Enum

Create a state machine with Enums for all that auto complete goodness.

Update

I prefer to tackle issues like this with Typescript


Credits